import request from '../utils/request'

export function list(params) {
    return request({
        url: '/admin/order/list',
        method: 'get',
        params: params
    })
}

export function orderList(params) {
    return request({
        url: '/admin/order/orderList',
        method: 'get',
        params: params
    })
}

export function find(id) {
    return request({
        url: '/admin/order/find/' + id,
        method: 'get'
    })
}


export function calculate(data) {
    return request({
        url: '/admin/order/calculate',
        method: 'post',
        data: data
    })
}


export function save(data, params) {
    return request({
        url: '/admin/order/save',
        method: 'post',
        data: data,
        params: params
    })
}

export function saveAndConfirm(params,data) {
  return request({
      url:'/admin/order/saveAndConfirm',
      method: 'post',
      data: data,
      params: params
  })
}

export function confirm(id, data) {
    return request({
        url: '/admin/order/confirm/' + id,
        method: 'post',
        data: data,
    })
}


export function shipping(id, data, params) {
    return request({
        url: '/admin/order/shipping/' + id,
        method: 'post',
        data: data,
        params: params
    })
}


export function summary() {
    return request({
        url: '/admin/order/summary',
        method: 'post',
    })
}


export function getHistoryList(params) {
    return request({
        url: '/admin/order/getHistoryList',
        method: 'post',
        params: params
    })
}


export function returns(id,data) {
    return request({
        url: '/admin/order/returns/' + id,
        method: 'post',
        data:data
    })
}


export function last(params) {
    return request({
        url: '/admin/order/last',
        method: 'get',
        params:params
    })
}

export function cancel(id) {
    return request({
        url: '/admin/order/cancel/' + id,
        method: 'post',
    })
}